const express=require('express')

const  mongoose=require('mongoose')
const app=express()


mongoose.connect('mongodb://localhost/playing')
.then(res=>{console.log('连接成功')})
.catch(err=>{console.log('连接失败')})



const course=new mongoose.Schema({
    name:String,
    age:Number,
    isflag:Boolean
})


const sheets=mongoose.model('lisi',course)

   

for(var i=0;i<10;i++) {
   let mysheets=   new  sheets({
          name:'zs'+i,
          age:i,
          isflag:i%2==0?true:false
      })
        mysheets.save()
}


app.listen(3000,()=>{
    console.log('3000启动')
})